<?
$t = $args['tour'];
$title = $t->getTitle();
$startDate = $t->getStartDate('F d, Y');
$endDate = $t->getEndDate("F d, Y");
$description = $t->getDescription();
$result = $t->getShows();
if (count($result) > 0) {
	$shows = array();
	foreach($result as $sh) {
		$st = new SectionTemplate;
		$st->file = "tour_show.php";
		$st->args['show'] = $sh;
		$shows[] = $st;
	}
}		
$tst = new SectionTemplate;
$tst->file = "tour_shows.php";
$tst->args['tour'] = $t;

$photoArea = $t->getPhotoAreaObject();
if (!db::isError($photoArea)) {
	$numPhotos = $photoArea->getNumFiles();
	if ($numPhotos > 0) {
		$photos = new SectionTemplate;
		$photos->file = "gallery.php";
		$photos->args['area'] = &$photoArea;
		if (USE_MOD_REWRITE) {
			$photos->args['url'] = '/tour/' . $t->getID();
		} else {
			$photos->args['url'] = '/tours.php?id=' . $t->getID();
		}
	}
}

$avArea = $t->getAVAreaObject();
if (!db::isError($avArea)) {
	$numAudio = $avArea->getNumFiles();
	if ($numAudio > 0) {
		$av = new SectionTemplate;
		$av->file = "media_list.php";
		$av->args['area'] = &$avArea;
		if (USE_MOD_REWRITE) {
			$av->args['url'] = '/tour/' . $t->getID();
		} else {
			$av->args['url'] = '/tours.php?id=' . $t->getID();
		}
	}
}